home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / arexx / dizaster.lha / Dizaster next >
Text File  |  1996-04-18  |  5KB  |  2 lines

  1. /* Optimized with RexxOpt 1.8 */
  2. version='$VER: Dizaster V 1.0 (17/04/96)';author='Kim Vermeersch - kimv@cycor.ca TA#6516';NL='0a'x;rtoolsLIB="rexxreqtools.library";IF ~SHOW('L',rtoolsLIB) THEN call addlib(rtoolsLIB,0,-30,0);call rtezrequest("Welcome to Dizaster"||NL||"¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯"||NL||"DizLIST offers a means of creating"||NL||"a BBS style file listing from a "||NL||"group of archives containing the"||NL||"File_ID.diz information...","Continue");call rtezrequest("The file requester has the ability"||NL||"to allow you to pick more than one"||NL||"file (use Shift to extend-select),"||NL||"or pick ALL for the entire directory.","Continue");retryfile:;filename=rtfilerequest(,,"Pick some files to process",,"rtfi_flags = freqf_multiselect",files);if ~files then;DO;call rtezrequest("You didn't pick any files."||NL||"Do you wish to abort?"," _Retry |_Cancel");if rtresult==0 then signal abort;else signal retryfile;END;call rtezrequest("Next you will be prompted for a filename."||NL||"Choose the name of the FILE LIST that you"||NL||"wish to use.","Continue");retrylist:;filename=rtfilerequest(,,"Pick a file",,"rtfi_buffer = true");listfile=filename;if rtresult==0 then;DO;call rtezrequest("You didn't pick a file."||NL||"Do you wish to abort?"," _Retry |_Cancel");if rtresult==0 then signal abort;else signal retrylist;END;else;if exists(filename) then;DO;call rtezrequest("File EXISTS!"||NL||filename,"APPEND|OverWrite|Pick Another|Abort");if rtresult==1 then if ~open(outfile,listfile,'Append') then exit 10;if rtresult==2 then if ~open(outfile,listfile,'Write') then exit 10;if rtresult==3 then signal retrylist;if rtresult==0 then signal abort;END;else;if ~open(outfile,listfile,'Write') then exit 10;Processfiles:;line=space('',79);DO i=1 to files.count;newline="";currentfile=files.i;DO forever;x=0;x=pos(':',currentfile);if x>0 then currentfile=right(currentfile,length(currentfile)-x);else break;END;DO forever;x=0;x=pos('/',currentfile);if x>0 then currentfile=right(currentfile,length(currentfile)-x);else break;END;workingdir=left(files.i,length(files.i)-length(currentfile));ArchType=UPPER(right(currentfile,3));longfile=0;if length(currentfile)>12 then longfile=1;say 'Processing '||currentfile||'... ';idtext='No FILE_ID.DIZ';SELECT;WHEN ArchType='DMS' THEN ADDRESS command 'dmsdescript >nil: x t:FILE_ID.DIZ '||files.i;WHEN ArchType='LHA' THEN ADDRESS command 'lha x > NIL: '||files.i||' FILE_ID.DIZ T:';WHEN ArchType='LZX' THEN ADDRESS command 'lzx x > NIL: '||files.i||' FILE_ID.DIZ T:';WHEN ArchType='LZH' THEN ADDRESS command 'lha x > NIL: '||files.i||' FILE_ID.DIZ T:';WHEN ArchType='EXE' THEN ADDRESS command 'EXEDescript x > NIL: T:FILE_ID.DIZ '||files.i;WHEN ArchType='ZIP' THEN;DO;olddirectory=pragma('D','T:');ADDRESS command 'Unzip > NIL: '||files.i||'FILE_ID.DIZ ';pragma('D',olddirectory);END;WHEN ArchType='GIF' THEN;DO;olddirectory=pragma('D','T:');ADDRESS command 'Gifdesc >nil: e '||files.i||' FILE_ID.DIZ ';pragma('D',olddirectory);END;OtherWise ADDRESS command 'TxtExtract e > NIL: T:FILE_ID.DIZ '||files.i;END;if ~exists('T:FILE_ID.DIZ') then;DO;if ~open(idfile,"t:FILE_ID.DIZ",'Write') then exit 10;call writeln idfile,idtext;call close idfile;END;idtext="";open('FileID','T:FILE_ID.diz','r');DO until eof('FileID');idline=left(left(line,33)||readln('FileID'),78);idtext=idtext||idline||NL;END;idtext=right(idtext,length(idtext)-33);idtext=left(idtext,length(idtext)-2);close('FileID');addtolistfile:;ADDRESS COMMAND 'list >t:fileinfo '||files.i;open('fileinfo','t:fileinfo','r');dummy=readln('fileinfo');datesize=readln('fileinfo');close('fileinfo');filedate=left(right(datesize,18),9);filesize=left(right(datesize,36),8);thisfile=currentfile;if longfile=1 then thisfile='LONGNAME.'||ArchType;newline=left(thisfile||line,13)||'P';newline=newline||right(line||filesize,8)||' ';newline=newline||filedate||' ';newline=newline||idtext;call writeln(outfile,newline);if longfile=1 then call writeln(outfile,left(left(line,33)||'Long filename: 'currentfile||line,78));if exists('T:FILE_ID.DIZ')then address command 'delete T:FILE_ID.DIZ quiet';if exists('T:fileinfo')then address command 'delete T:fileinfo quiet';END;call close(outfile);signal quit;ABORT:;call rtezrequest("Aborting."||NL||""||NL||"Thank you for trying Dizaster.","QUIT!");signal QUIT;QUIT:;call rtezrequest("Don't forget to register."||NL||"¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯"||NL||"Dizaster is GIFTware."||NL||"Read the Dizaster.guide for more information"||NL||""||NL||"Comments or suggestions to kimv@cycor.ca","Return to DOS");call rtfreefilebuffer();exit 0